package com.dhy.socket;


import com.dhy.config.ClientConfig;
import lombok.extern.slf4j.Slf4j;

import java.io.IOException;
import java.io.OutputStream;
import java.net.Socket;

/**
 * @author 大忽悠
 * @create 2022/5/29 20:32
 */
@Slf4j
public class RedisClientSocket {
    private final ClientConfig config=new ClientConfig();
    private Socket client;

    /**
     * 建立socket连接,返回输出流
     */
    public Socket connect() throws IOException {
        client=new Socket(config.getHost(),config.getPort());
        log.info("connect success!!!");
        return client;
    }

    public ClientConfig getConfig(){
        return config;
    }
}
